/**
 * 2017年4月25日
 */
package service.wechatlab.impl;

import java.util.List;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import dao.wechatlab.SubmittedTaskDao;
import pojo.weichatlab.SubmittedTask;
import service.wechatlab.SubmittedTaskService;

/**
 * @author Alex
 *
 */
@Service
public class SubmittedTaskServiceImpl implements SubmittedTaskService {

	@Autowired SubmittedTaskDao std;

	@Override
	public void addTask(SubmittedTask st) {
		std.insertTask(st);
	}

	@Override
	public List<SubmittedTask> selectTaskByType(int type) {
		return this.std.seletByType(type);
	}

	@Override
	public List<SubmittedTask> selectTaskWord2vec() {
		return this.std.seletByType(0);
	}

	@Override
	public List<SubmittedTask> selectTaskLDA() {
		return this.std.seletByType(1);
	}

	@Override
	public List<SubmittedTask> selectTaskRNN() {
		return this.std.seletByType(2);
	}

	@Override
	public List<SubmittedTask> selectTaskByState(int state) {
		
		return this.std.seletByState(state);
	}

	@Override
	public List<SubmittedTask> selectTaskNew() {
		return this.std.seletByState(0);
	}

	@Override
	public List<SubmittedTask> selectTaskRunning() {
		return this.std.seletByState(1);
	}

	@Override
	public List<SubmittedTask> selectTaskSuccees() {
		return this.std.seletByState(2);
	}

	@Override
	public List<SubmittedTask> selectTaskFailed() {
		return this.std.seletByState(3);
	}

}
